  <?

  require_once '../Negocio/CsAtencionCaso.php';
  require_once '../Negocio/CsCaso.php';
  ?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        
        <table border="2">
            <tr>
            <form name="buscar" method="post" action="">
                <td>CODIGO <input type="text" name="codigo"> </td> 
                <td>  <input type="submit" name="b_buscar" value="Buscar"> </td>    
             </form>
            </tr>
        </table>
           
  <?          session_start();
   function buscarid()
  {
       $atencion_caso=new CsAtencionCaso();
    $atencion_caso->dato[0]=$_POST['codigo'];
    $dac=$atencion_caso->ConsultaAtencionCaso();
    
    $caso = new CsCaso ();
    $caso->dato[0]=$_POST['codigo'];
    $caso->dato[1]=$_SESSION['ident'];
    $ds = $caso->ConsultaCaso();
    ?>
        <table border ="2"width="600" height="100" border="0" align="center">
           <?$con = 0;
        while ($rows = mysql_fetch_array($ds)){
            $con++;?>
            <tr><td>CODIGO</td> <td class="fila<? echo $con%2; ?>"><? echo $rows[0]; ?></td></tr>
            <tr> <td>EMPLEADO</td> <td class="fila<? echo $con%2; ?>"><? echo $rows[1]; ?></td> </tr>
            <tr> <td>EMPRESA</td> <td class="fila<? echo $con%2; ?>"><? echo $rows[2]; ?></td> </tr>
            <tr> <td>DESCRIPCION</td> <td class="fila<? echo $con%2; ?>"><? echo $rows[3]; ?></td></tr>
            <tr> <td>FECHA</td> <td class="fila<? echo $con%2; ?>"><? echo $rows[4]; ?></td>
            <tr> <td>ESTADO</td> <td class="fila<? echo $con%2; ?>"><? echo $rows[5]; ?></td> </tr>    
            <?
            }
           ?>
       <? $cons=0;
           while($rows=mysql_fetch_array($dac)){
           $cons++;  ?>
            <tr><td>EMPLEADO</td> <td class="fila<? echo $cons%2; ?>"><? echo $rows[0]; ?></td></tr>
            <tr> <td>FECHA_ASIGNACION</td> <td class="fila<? echo $cons%2; ?>"><? echo $rows[1]; ?></td> </tr>
            <tr> <td>DIAGNOSTICO</td> <td class="fila<? echo $cons%2; ?>"><? echo $rows[2]; ?></td> </tr>
            <tr> <td>SOLUCION</td> <td class="fila<? echo $cons%2; ?>"><? echo $rows[3]; ?></td></tr>
            <tr> <td>OBSERVACION</td> <td class="fila<? echo $cons%2; ?>"><? echo $rows[4]; ?></td>
            <tr> <td>PRIORIDAD</td> <td class="fila<? echo $cons%2; ?>"><? echo $rows[5]; ?></td> </tr>  
            <?
           }
           ?>
        </table><?
    $vec = mysql_fetch_array($ds);
    $vec[0];    
    $vec1 = mysql_fetch_array($dac);
    $vec1[0];
  } 
                    if($_POST['b_buscar']=="Buscar")
                        {
                       // echo 'prueba';
                        buscarid();
                        }
    ?>
    </body>
</html>
